//
//  YLReplaceBankCardBeCarefulFooterView.m
//  YLFinanceService
//
//  Created by she1323 on 2017/11/7.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "YLReplaceBankCardBeCarefulFooterView.h"
#import <Masonry.h>
#import "YLGlobeHeader.h"
@interface YLReplaceBankCardBeCarefulFooterView()


@end

@implementation YLReplaceBankCardBeCarefulFooterView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setUp];
    }
    return self;
}

- (void)setUp
{
    UILabel *titleLabel = [[UILabel alloc] init];
    [self addSubview:titleLabel];
    titleLabel.text = @"银行卡更换注意事项";
    titleLabel.font = [UIFont systemFontOfSize:12.0f];
    titleLabel.textColor = YLMainColor;
    
    __weak typeof(self) weakSelf = self;
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(weakSelf).mas_offset(-20);
        make.height.mas_equalTo(15);
        make.centerX.mas_equalTo(weakSelf).mas_offset(5);
    }];
    
    UIImageView *icon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"beCareful"]];
    [self addSubview:icon];
    [icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(titleLabel);
        make.right.mas_equalTo(titleLabel.mas_left).mas_offset(-10);
        make.width.mas_equalTo(titleLabel.mas_height);
    }];
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(click)];
    [self addGestureRecognizer:tap];
}
- (void)click
{
    if (self.clickBlock) {
        self.clickBlock();
    }
}

@end
